<div>
    <input v-if="!fileInputDestroy" input type = file id="xlf"  style="display: none" @change="xlFileChange" >
    <div v-if="excelView">
        <kf-table
                ref="baseTable"
                :data="excelDate"
                 stripe=true
                  page-size:20
        >
            <el-table-column prop="flightInfo.flightNum"  label="航班号"  min-width="120">
            </el-table-column>
            <el-table-column  prop="flightInfo.flightType" label="机型" min-width="120" >
            </el-table-column>
            <el-table-column  prop="expectDate" label="预约日期" min-width="100" >
            </el-table-column>
            <el-table-column prop="importOrExport" label="进出港" min-width="100">
            </el-table-column>
            <el-table-column  label="预约航线" min-width="150" prop="originating">
                <template scope="scope">{{scope.row.originating+"-"+scope.row.destination}}</template>
            </el-table-column>
            <el-table-column prop="planeStatus" label="状态" width="80">
            </el-table-column>
            <el-table-column prop="takeOffTime" label="预起" width="150">
            </el-table-column>
            <el-table-column prop="arriveTime" label="计达" width="150">
            </el-table-column>
        </kf-table>
        <el-form :inline="true" :model="formInline"  ref="formInline" class="demo-form-inline" label-width="100px"  style="margin-top: 20px;">
            <el-row>
                <el-form-item label=" ">
                    <el-button type="primary" @click="batchSave"> 保存</el-button>
                    <el-button type="primary" @click="batchSaveAndPublish">保存发布</el-button>
                    <el-button type="primary" @click="closeExcelTable">取消导入</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <el-form :inline="true" :model="formInline"  ref="formInline" class="regular-form" label-width="120px" v-if="!excelView">
        <el-row>
            <el-form-item label="航班号"  prop="flightInfo.flightInfoId":rules
                    ="[ {required: true, message: '航班号不能为空'}]">
                <el-select v-model="formInline.flightInfo.flightInfoId" filterable placeholder="请选择" @change="handleSelect" >
                    <el-option
                            v-for="plane in planes"
                            :key="plane.flightInfoId"
                            :label="plane.flightNum"
                            :value="plane.flightInfoId"
                            >
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="预约日期"  prop="expectDate":rules
                    ="[ {required: true, message: '预约日期不能为空'}]">
                <el-date-picker
                        v-model="formInline.expectDate"
                        align="right"
                        type="date"
                        placeholder="选择日期"
                        format="yyyy-MM-dd"
                        @change="pickExpectDate"

                >
                </el-date-picker>
            </el-form-item>
        </el-row>
        <el-row>
            <el-form-item label="机型" >
                <el-input v-model="flightInfo.flightType" placeholder="机型" :disabled="true" ></el-input>
            </el-form-item>

            <el-form-item label="机号" >
                <el-input v-model="flightInfo.flightNo" placeholder="机号" :disabled="true" ></el-input>
            </el-form-item>


        </el-row>
        <el-row>

        <el-form-item label="预约航线: 从" prop="originating":rules
                ="[ {required: true, message: '出发地不能为空'},{max:30,message:'长度不能超过30位'}]">
                <el-autocomplete
                        class="inline-input"
                        v-model="formInline.originating"
                        :fetch-suggestions="querySearchPlace"
                        placeholder="请输入内容"
                        :disabled="(parentData&&parentData.onlyTime)"
                >
                </el-autocomplete>
            </el-form-item>
            <el-form-item label="到" prop="destination":rules
                    ="[ {required: true, message: '目的地地不能为空'},{max:30,message:'长度不能超过30位'}]">
                <el-autocomplete
                        class="inline-input"
                        v-model="formInline.destination"
                        :fetch-suggestions="querySearchPlace"
                        placeholder="请输入内容"
                        :disabled="(parentData&&parentData.onlyTime)"
                >
                </el-autocomplete>
            </el-form-item>
        </el-row>
        <el-row>

            <el-form-item  label="计划起飞时间" prop="takeOffTime":rules
                    ="[ {required: true, message: '计划起飞时间不能为空'}]">
                <el-date-picker
                        v-model="formInline.takeOffTime"
                        type="datetime"
                        placeholder="计划起飞时间"
                        format="yyyy-MM-dd HH:mm"
                        @change="pickTakeOffTime"
                >
                </el-date-picker>
            </el-form-item>
            <el-form-item  label="计划到达时间" prop="arriveTime":rules
                    ="[ {required: true, message: '计划到达时间不能为空'}]" label-width="120px">
                <el-date-picker
                        v-model="formInline.arriveTime"
                        type="datetime"
                        placeholder="计划到达时间"
                        format="yyyy-MM-dd HH:mm"
                        @change="pickArriveTime"

                >
                </el-date-picker>
            </el-form-item>
        </el-row>
        <el-row>
            <!--:rules-->
            <!--="[ {required: true, message: '预预起飞时间不能为空'}]">-->
            <el-form-item v-show="!(parentData&&parentData.onlyTime)" label="预预起飞时间" prop="preFlyTime">
                <el-date-picker
                        v-model="formInline.preFlyTime"
                        type="datetime"
                        placeholder="预预起飞时间"
                        format="yyyy-MM-dd HH:mm"
                        @change="pickPreFlyTime"
                >
                </el-date-picker>
            </el-form-item>
            <!--:rules-->
            <!--="[ {required: true, message: '预计到达时间不能为空'}]"-->
            <el-form-item  v-show="!(parentData&&parentData.onlyTime)" label="预计到达时间" prop="preArriveTime" label-width="120px">
                <el-date-picker
                        v-model="formInline.preArriveTime"
                        type="datetime"
                        placeholder="预计到达时间"
                        format="yyyy-MM-dd HH:mm"
                        @change="pickPreArriveTime"

                >
                </el-date-picker>
            </el-form-item>
        </el-row>
        <el-row>
            <el-form-item label=" ">
                <el-button v-show="!(parentData&&parentData.onlyTime)" type="primary" @click="save">    保存    </el-button>
                <el-button v-show="(parentData&&parentData.onlyTime)" type="primary" @click="save">    修改    </el-button>
                <el-button v-show="(parentData&&parentData.onlyTime)" type="primary" @click="saveAndPublish">生成计划</el-button>
                <el-button v-show="!(parentData&&parentData.onlyTime)" type="primary" @click="saveAndPublish">保存发布</el-button>

            </el-form-item>
            <el-form-item>
                <el-input placeholder="请输入内容" v-if="!(parentData&&parentData.unShowExcel)"  v-model="xlfName" v-loading="!jsLoaded">
                    <template slot="prepend"><label for="xlf" class="el-button el-button--primary">excel导入</label></template>
                </el-input>
            </el-form-item>
        </el-row>
    </el-form  >
</div>